


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="htmlId">
<head>
  <title>Coverage Report :: RockPaperScissors</title>
  <style type="text/css">
    @import "../../.css/coverage.css";
  </style>
</head>

<body>
<div class="header"></div>

<div class="content">
<div class="breadCrumbs">
    [ <a href="../../index.html">all classes</a> ]
    [ <a href="../index.html">fr.p10.miage.rps.model</a> ]
</div>

<h1>Coverage Summary for Class: RockPaperScissors (fr.p10.miage.rps.model)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">RockPaperScissors</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/ 1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (2/ 2)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (7/ 7)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<div class="sourceCode"><i>1</i>&nbsp;package fr.p10.miage.rps.model;
<i>2</i>&nbsp;
<i>3</i>&nbsp;/**
<i>4</i>&nbsp; * Created with IntelliJ IDEA.
<i>5</i>&nbsp; * User: naberrad
<i>6</i>&nbsp; * Date: 21/10/13
<i>7</i>&nbsp; * Time: 16:08
<i>8</i>&nbsp; * To change this template use File | Settings | File Templates.
<i>9</i>&nbsp; */
<i>10</i>&nbsp;public class RockPaperScissors {
<i>11</i>&nbsp;
<b class="fc"><i>12</i>&nbsp;    public RockPaperScissors() {</b>
<b class="fc"><i>13</i>&nbsp;    }</b>
<i>14</i>&nbsp;
<i>15</i>&nbsp;    public Result play(RPSEnum p1, RPSEnum p2) {
<b class="fc"><i>16</i>&nbsp;        if (p2.equals(p1)) {</b>
<b class="fc"><i>17</i>&nbsp;            return Result.TIE;</b>
<b class="fc"><i>18</i>&nbsp;        } else if (p1.equals(RPSEnum.PAPER) &amp;&amp; p2.equals(RPSEnum.ROCK)</b>
<i>19</i>&nbsp;                || p1.equals(RPSEnum.ROCK) &amp;&amp; p2.equals(RPSEnum.SCISSORS)
<i>20</i>&nbsp;                || p1.equals(RPSEnum.SCISSORS) &amp;&amp; p2.equals(RPSEnum.PAPER)) {
<b class="fc"><i>21</i>&nbsp;            return Result.WIN;</b>
<i>22</i>&nbsp;        } else {
<b class="fc"><i>23</i>&nbsp;            return Result.LOST;</b>
<i>24</i>&nbsp;        }
<i>25</i>&nbsp;    }
<i>26</i>&nbsp;}
<i>27</i>&nbsp;
</div>
</div>

<div class="footer">
    
    <div style="float:right;">generated on 2013-10-28 10:44</div>
</div>
</body>
</html>
